home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / bbs / twall62s.zip / thewall.mh < prev    next >
Text File  |  1996-07-27  |  2KB  |  96 lines

  1. void cutchar(ref string: line, int: index);
  2. void inputstring(ref string: line, int: maxlen);
  3.  
  4. #ifndef __INPUT_MH
  5. #include <input.mh>
  6. #endif
  7.  
  8. struct _line
  9.   {
  10.    array[1..5] of string: text;
  11.    array[1..5] of string: colour;
  12.    array[1..5] of int: x;
  13.    array[1..5] of int: y;
  14.   };
  15.  
  16. struct _line: ln;
  17.  
  18. void dec(ref int: x)
  19. {
  20.  x := x - 1;
  21. }
  22.  
  23. void gotoxy(int: x, int: y)
  24. {
  25.  print(AVATAR_GOTO, (char)x, (char)y);
  26. }
  27.  
  28. string getline(int: f, string: colour)
  29. {
  30.  string: line;
  31.  print(AVATAR_GOTO, (char)ln.x[f], (char)ln.y[f]);
  32.  print ("                                                             ");
  33.  print(AVATAR_GOTO, (char)ln.x[f], (char)ln.y[f]);
  34.  print(colour);
  35.  if (ln.text[f]<>"") line:=ln.text[f];
  36. // input_str(line, INPUT_NOCLEOL | INPUT_NOCTRLC | INPUT_DEFAULT, 0, 61, "");
  37.  inputstring(line, 61);
  38.  return line;
  39. }
  40.  
  41. void showline(int: f)
  42. {
  43.  print (AVATAR_GOTO, (char)ln.x[f], (char)ln.y[f]);
  44.  print ("                                                             ");
  45.  print (AVATAR_GOTO, (char)ln.x[f], (char)ln.y[f]);
  46.  if (f>1) print (current_colour);
  47.  if (f=1) current_colour:=LIGHTGREEN;
  48.  print (strpad(colstring(ln.text[f]),61,' '));
  49.  ln.colour[f]:=current_colour;
  50. }
  51.  
  52. void blankline(int: f)
  53. {
  54.  print (AVATAR_GOTO, (char)ln.x[f], (char)ln.y[f]);
  55.  print ("                                                             ");
  56. }
  57.  
  58. void update(int:f)
  59. {
  60.  char: nomore;
  61.  
  62.  nomore:=FALSE;
  63.  
  64.  for(f; f<=5; f:=f+1)
  65.  {
  66. //  if (ln.text[f]="/q") nomore:=TRUE;
  67.   if (nomore=FALSE) showline(f);
  68.    else blankline(f);
  69.  }
  70. }
  71.  
  72. string getsig(string: signature)
  73. {
  74. // string: signature;
  75.  
  76.  print(AVATAR_GOTO, (char)12, (char)24);
  77.  print("                              ");
  78.  print(AVATAR_GOTO, (char)12, (char)24);
  79. // input_str(signature, INPUT_NOCLEOL | INPUT_NOCTRLC, 0, 30, signcolour);
  80.  print(signcolour);
  81.  inputstring(signature,30);
  82. // replaced input_str with inputstring
  83.  print(AVATAR_GOTO, (char)12, (char)24);
  84.  print("                              ");
  85.  print(AVATAR_GOTO, (char)12, (char)24);
  86.  print(strpad(colstring(signature),30,' '));
  87.  return signature;
  88. }
  89.  
  90. void pause()
  91. {
  92.  print(COL_LRED+"\nTap any key..");
  93.  getch();
  94.  print("\n");
  95. }
  96.